﻿#ifndef PST_POSTLINEEDIT_H
#define PST_POSTLINEEDIT_H

#include <QLineEdit>

namespace pst
{
    //添加点击下拉框就发信号的功能
    class PostLineEdit : public QLineEdit
    {
        Q_OBJECT

    public:
        explicit PostLineEdit(QWidget* parent = nullptr) : QLineEdit(parent) {}

    signals:
        void clicked();

    protected:
        void mousePressEvent(QMouseEvent* e) override
        {
            if (e->button() == Qt::LeftButton)
            {
                emit clicked();
            }
            // 保持原有交互行为
            QLineEdit::mousePressEvent(e);
        }
    };

}
#endif
